set nocompatible

let curdir = expand('<sfile>:p:h')
execute 'set runtimepath+=' . curdir . '/.vim'
call plug#begin(curdir . '/.vim/plugged')

Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug expand('<sfile>:p:h:h:h')

call plug#end()

set noswapfile
set hidden

autocmd BufRead *.ts setlocal filetype=typescript
autocmd BufRead *.rs setlocal filetype=rust

let g:LanguageClient_devel = 1
let g:LanguageClient_loggingLevel = 'INFO'
let g:LanguageClient_useVirtualText = 'CodeLens'
let g:LanguageClient_loggingFile = expand('~/.local/share/nvim/LanguageClient.log')
let g:LanguageClient_serverStderr = expand('~/.local/share/nvim/LanguageServer.log')
let g:LanguageClient_serverCommands = {
    \ 'javascript': ['javascript-typescript-stdio'],
    \ 'typescript': ['javascript-typescript-stdio'],
    \ 'rust': ['rust-analyzer'],
    \ }
let g:LanguageClient_selectionUI = 'location-list'
set formatexpr=LanguageClient#textDocument_rangeFormatting_sync()
" Not supported by neovim in debian
" set signcolumn=yes

function! HandleWindowProgress(params) abort
    echomsg json_encode(a:params)
endfunction
